/*
 * @LastEditors: yuSeen
 * @LastEditTime: 2022-01-11 11:57:50
 */

import React, { useEffect } from "react";
import { useDisplayModeSetting } from "@/hooks/setting/useDisplayModeSetting";
import { useLocation, useNavigate, useRoutes } from "react-router-dom";
import routes from "./router/router";

const App: React.FC = () => {
  const { displayMode, setDisPlayMode } = useDisplayModeSetting();
  const Navigate = useNavigate();
  const {pathname} = useLocation();
  useEffect(() => {
    setDisPlayMode(displayMode);
    pathname === '/' && Navigate("/foundMusic/recommend");
  }, []);
  return useRoutes(routes);
};

export default App;
